<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>软件开发交流平台</title>
	<link href="../css/head.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		function top_check(){
			if(top_login.name.value==""){
				alert("用户名不能为空");
				top_login.name.focus();
				return false;
			}
			else if(top_login.pwd.value==""){
				alert("密码不能为空");
				top_login.pwd.focus();
				return false;
			}
			else{
				return true;
			}
		}
		function forwardregister(){
			window.location.href("register.jsp");
			return true;
		}
	</script>
</head>
<body>
<div id="header">
<div id="top">
	<div id="top1" style="width:1024px; height: 46px">
		<div id="top_title"><img  src="../images/common/top_title.gif"/></div>
		<%
			boolean logined=false; 
			String Name=(String)session.getAttribute("Nickname");
			if(Name!=null) logined=true;
			if(logined){
				String Phosrc=null;
				String saveurl=request.getRealPath("/")+"Photo"+"\\"+(String)session.getAttribute("PhoSrc");
        		java.io.File file = new java.io.File(saveurl); 	//读入刚才上传的文件
        		if(file.exists())
	        	{
	        		Phosrc="../Photo/"+(String)session.getAttribute("PhoSrc");
	        	}
	        	else Phosrc="../Photo/photo90.jpg";
		%>
		<div id="top_logined">
			<img src="/ceshi/images/common/top_logined_content.gif" border="0" usemap="#Map_logined"/>
            <map name="Map_logined" id="Map_logined">
            <area shape="rect" coords="214,7,257,29" href="login.jsp?action=exit" />
            <area shape="rect" coords="168,7,211,29" href="selhome_main.jsp" />
            <area shape="rect" coords="105,7,165,29" href="selhome_message.jsp" />
            <area shape="rect" coords="59,7,102,29" href="#" />
            <area shape="rect" coords="13,7,56,29" href="jifen.jsp" />
            </map> 
			<img width="30px" height="30px" style="margin-top:auto; margin-bottom:2px;"  src="<%=Phosrc %>"/>
	    </div>
	    <%
		}
		else{
	    %>
		<div id="top_login">
				  <form  name="top_login" method="post" action="login.jsp" onsubmit="return top_check()">
				  <table  style="margin-top:12px; padding:0px;" width="365" height="22" border="0"cellpadding="0" cellspacing="0">
				  <tr >
					<td width="113"><input name="name" class="content" type="text" /></td>
					<td width="113"><input name="pwd" class="pssword" type="password" /></td>
                    <td> <input  value="" type="submit" class="buttonlo"  /></td>
					<td> <input  type="button" onclick="return forwardregister()"  class="buttonre" /></td>
				  </tr>
					</table>
				</form>
		</div>
		<%} %>
	</div>
	<div id="top2" style="margin-top:39px;">
		<div id="top_content">
			<div style="width:235px; padding-top:9px; float:left">
				<img src="../images/common/top_chanle_main.gif" border="0" usemap="#Map_Top_Content1" style="margin-left:14px;" />
                <map name="Map_Top_Content1" id="Map_Top_Content1">
                  <area shape="rect" coords="-12,-11,86,46" href="index.jsp" />
                </map>
				<img src="../images/common/top_chanle_center.gif" border="0" usemap="#Map_Top_2" style="margin-left:17px;"/>
                <map name="Map_Top_2" id="Map_Top_2">
                  <area shape="rect" coords="-14,-14,53,18" href="selhome_main.jsp" />
                </map>
				<img src="../images/common/top_chanle_link.gif" border="0" usemap="#Map_Top_3" style="margin-left:17px;"/>
                <map name="Map_Top_3" id="Map_Top_3">
                  <area shape="rect" coords="-7,-4,76,34" href="#" />
                </map>
            </div>
			<div style="height:27px; width:235px; margin-left:455px;" >
			<form id="top_reaserch" name="top_login" method="post" action="search.jsp">
			<table width="200" border="0" cellspacing="0" cellpadding="0" >
			  <tr>
				<td><input name="search_con" style="background:url(../images/common/top_serch_content.gif); width:207px; height:20px;border:0px; padding-top:7px;" type="text" />
				</td>
				<td><input  value=""type="submit" style="background:url(../images/common/top_serch_button.gif); width:28px; height:27px;border:0px; " />
				</td>
			  </tr>
			</table>
			</form>
			</div>
		</div>
	</div>
</div>
</div>

</body>
</html>
